import axios from 'axios'
import cookie from 'js-cookie'
let request = axios.create({
  baseURL: 'http://localhost:9001',
  timeout: 20000
})
// http request 拦截器
request.interceptors.request.use(
  config => {
    //debugger
    if (cookie.get('guli_token')) {
      config.headers['token'] = cookie.get('guli_token')
    }
    return config
  },
  err => {
    return Promise.reject(err)
  })

export default request
